#!/bin/bash
echo "start record mysql"
sh ./record.sh mysql firo test20m 60 &
i=0
while [ $i -lt 10 ]
do
echo "start test mysql $1"
php test20m_mysql.php 10000000 >> /data/www/htdocs/firo/scripts/logs/test20m_mysql.log &
i=`expr $i + 1`
done
count=`ps -ef|grep test20m_mysql.php|grep -v "grep" -c`
while [ $count -gt 0 ]
do
count=`ps -ef|grep test20m_mysql.php|grep -v "grep" -c`
echo $count
sleep 5
done
ps -ef|grep record.sh|grep -v "grep"|awk '{printf("kill -9 %s\n",$2)}' |sh

sleep 10
	
echo "start record mongo"
sh ./record.sh mongo firo test20m 60 &
i=0
while [ $i -lt 10 ]
do
echo "start test mongo $1"
php test20m_mongo.php 10000000 >> /data/www/htdocs/firo/scripts/logs/test20m_mongo.log &
i=`expr $i + 1`
done
count=`ps -ef|grep test20m_mongo.php|grep -v "grep" -c`
while [ $count -gt 0 ]
do
count=`ps -ef|grep test20m_mongo.php|grep -v "grep" -c`
echo $count
sleep 5
done
ps -ef|grep record.sh|grep -v "grep"|awk '{printf("kill -9 %s\n",$2)}' |sh